package com.hairline.service;

import com.hairline.bean.UserExample;
import com.hairline.bean.vo.UserIndexOrderVO;
import com.hairline.bean.vo.UserIndexVO;
import com.hairline.mapper.OrderMapper;
import com.hairline.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WxUserServiceImpl implements WxUserService {

    @Autowired
    OrderMapper orderMapper;

    @Autowired
    UserMapper userMapper;

    @Override
    public UserIndexVO userIndex(String username) {
        Integer id = userMapper.selectIdByName(username);
        UserIndexOrderVO userIndexOrderVO = orderMapper.selectOrderInfoForIndex(id);
        return new UserIndexVO(userIndexOrderVO);
    }
}
